package com.atguigu.srb.core.controller.api;


import com.atguigu.srb.base.result.R;
import com.atguigu.srb.core.pojo.entity.LendItemReturn;
import com.atguigu.srb.core.service.LendItemReturnService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 标的出借回款记录表 前端控制器
 * </p>
 *
 * @author Atguigu
 * @since 2023-01-04
 */
@RestController
@RequestMapping("/api/core/lendItemReturn")
public class ApiLendItemReturnController {
    @Resource
    LendItemReturnService lendItemReturnService;

    @ApiOperation("查询标的回款计划")
    @GetMapping("/list/{lendId}")
    public R listByLendId(@PathVariable("lendId")String lendId){
        return R.ok().data("items" , lendItemReturnService
            .list(Wrappers.lambdaQuery(LendItemReturn.class)
                .eq(LendItemReturn::getLendId ,lendId)));
    }
}

